import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'
import index from "../layout/index.vue"
import home from '../views/Home'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'index',
    redirect:'home',
    component: index,
    children:[{
      path:'',
      component:home
    }, {
      path: '/singer',
      component: () => import("../views/singer")
    },{
      path: '/songList',
      component: () => import("../views/songList")
    },{
      path: '/mine',
      component: () => import("../views/mine")
    },{
      path: '/search',
      component: () => import("../views/search")
    },
      {
        path: '/singerList',
        component: () => import("../views/singerList")
      }
    ]
  },
  {
    path: '/musicPlay',
    name: 'musicPlay',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component:() => import( '../views/musicPlay')
  },
 {
   path: '/songVerbose',
       name: 'songVerbose',
     component:() => import( '../views/songVerbose')
 }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
